<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Facelet Title</title>
    </h:head>
    <h:body>
       

         <table border="0" id="detail-table">
            <h:form id="tour" >
                <tbody>

                    <tr>
                        <td>Tour Name</td>
                        <td><h:inputText value="#{tourBean.ptour.packageTourName}" styleClass="inp-form" id="txtTourName" requiredMessage="please input name" required="true"></h:inputText></td>
                        <td><h:message for="txtTourName"  ></h:message></td>
                    </tr>
                    <tr>
                        <td>Package Type</td>
                        <td> <h:selectOneMenu value="#{tourBean.packageID}" styleClass="styledselect_form_1">
                                <f:selectItems value="#{tourBean.lpackagetype}" var="package" itemLabel="#{package.packageTypeName}" itemValue="#{package.packageTypeID}"></f:selectItems>
                            </h:selectOneMenu></td>
                    </tr>
                    <tr>
                        <td>Location</td>
                        <td> <h:selectOneMenu value="#{tourBean.locationID}" styleClass="styledselect_form_1" onchange="submit()" valueChangeListener="#{tourBean.placeChangeByID}">
                                <f:selectItems value="#{tourBean.llocation}" var="loc" itemLabel="#{loc.locationName}" itemValue="#{loc.locationID}"></f:selectItems>
                            </h:selectOneMenu></td>
                    </tr>
                    <tr>
                        <td>Place</td>
                        <td> <h:selectOneMenu value="#{tourBean.placeID}" styleClass="styledselect_form_1" onchange="submit()" valueChangeListener="#{tourBean.hotelChangeByID}">
                                <f:selectItems value="#{tourBean.lplaces}" var="place" itemLabel="#{place.placeName}" itemValue="#{place.placeID}"></f:selectItems>
                            </h:selectOneMenu> </td>
                    </tr>
                    <tr>
                        <td>Hotel</td>
                        <td> <h:selectOneMenu value="#{tourBean.hotelID}" styleClass="styledselect_form_2">
                                <f:selectItems value="#{tourBean.lhotel}" var="hotel" itemLabel="#{hotel.hotelName}" itemValue="#{hotel.hotelID}"></f:selectItems>
                            </h:selectOneMenu></td>
                    </tr>
                    <tr>
                        <td>Price</td>
                        <td><h:inputText value="#{tourBean.ptour.price}"  styleClass="inp-form" onblur="testResults(this.form);" id="txtPrice" required="true"></h:inputText></td>
                    </tr>
                    <tr>
                        <td>Travel</td>
                        <td><h:selectOneMenu value="#{tourBean.ptour.travel}" styleClass="styledselect_form_2">
                                <f:selectItem itemLabel="Plane" itemValue="airport"></f:selectItem>
                                <f:selectItem itemLabel="car" itemValue="car"></f:selectItem>
                                <f:selectItem itemLabel="train" itemValue="train"></f:selectItem>
                            </h:selectOneMenu></td>
                    </tr>
                    <tr>
                        <td>Status</td>
                        <td><h:selectOneMenu value="#{tourBean.ptour.available}" styleClass="styledselect_form_2">
                                <f:selectItem itemLabel="active" itemValue="0"></f:selectItem>
                                <f:selectItem itemLabel="wait" itemValue="1"></f:selectItem>

                            </h:selectOneMenu></td>
                    </tr>

                    <tr>
                        <td>Description</td>
                        <td> <h:inputTextarea   styleClass="form-textarea2" value="#{tourBean.ptour.description}" id="txtdes"></h:inputTextarea></td>
                    </tr>
                    <tr>
                        <td>From Date</td>
                        <td> <p:calendar pattern="yyyy-mm-dd"  value="#{tourBean.fdate}" id="txtfdate"></p:calendar></td>
                    </tr>
                    <tr>
                        <td>To Date</td>
                        <td> <p:calendar pattern="yyyy-mm-dd" value="#{tourBean.edate}" onblur="testDates(this.form);" id="txtedate" required="true"></p:calendar></td>
                    </tr>

                    <tr>
                        <td>Image</td>
                        <td><p:fileUpload widgetVar="uploader2" fileUploadListener="#{uploadbean.fileUpload}" id="UploadPath" auto="true" ></p:fileUpload></td>
                    </tr>
                    <tr>
                        <td><h:commandButton value="Create" action="#{tourBean.createTour}" styleClass="form-submit"></h:commandButton></td>

                    </tr>


                </tbody>
            </h:form>
        </table>

            

    </h:body>
</html>

